<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="my" uri="http://www.trkj.com/tr1702/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style>

 
	#list_lookup{
		width:420px;
	}
</style>
<body>

<script type="text/javascript">
		$(function() {

			$("#ace").linkbutton({
				onClick : function() {
					$('#one').panel({
						href : 'Lzs_salarysabletj',
					});
				}
			});

			
		});   
		
		$('.search_a').linkbutton({
			onClick : function() {
				$('.mod-add-data-a').datagrid({ url:'lzs_SalarySablechaxun?text='+$('#search_input_a').val() });//重新指定url
                alert(text)
				$('.mod-add-data-a').datagrid('load',{  
                });
			}
		});
		
		/*操作图标*/
		var sroleFormatter = function(value,row,index){
			var wrong = " <a class='cell_btn_wrong_a' onclick='wrong(" + row.templateId + ")'>	</a>";
			var edit="";
		<my:g id="140">	edit = " <a class='cell_btn_edit_b' onclick='editRole(" + row.templateId + ")'>编辑</a>";</my:g>
			
		var   del="";
		<my:g id="139">   del = " <a class='cell_btn_del_c' onclick='delRoley(" + row.templateId + ")'>删除</a>";</my:g>
			return wrong+edit+del;
		}
		/* 操作图标*/
 		$("#xiugai_lzs").datagrid({onLoadSuccess: function(){

			$(".cell_btn_edit_b").linkbutton({iconCls:'icon-add', plain:true});
			$(".cell_btn_del_c").linkbutton({iconCls:'icon-cancel', plain:true});
		}});
		/*修改*/
		
		var editRole=function(templateId){
			
			$('.rule_result_update_a').form('load','lzs_SalarySablebj?templateId='+templateId);
			alert("3");
			$('#update-rule_result_z').dialog("open");
		
		}
		//浏览项目
		//获取th的id浏览界面跳转
		$('#xiugai_lzs').datagrid({
			onDblClickRow: function(index,row){
				$("#one").panel({
					href:"findOneTemplate?templateId="+row.templateId
				});
			}
		}); 
		
		/*删除*/
		function delRoley(templateId){
	 		$.messager.confirm('确认', '您确定要删除吗？', function(v){
	 			if(v){
	 				$.post("hr_ra_form_SalarySable", {templateId:templateId}, function(){
						$('#xiugai_lzs').datagrid('reload');
					});
	 			}
				
			});
	 	}
		/* //双击选中行进入项目信息页面
		$("#template_table").datagrid({
		onDblClickRow:function(index,row){
		$("#template").panel({
		href:"findOneTemplate?templateId="+row.templateId
		})
		}
		}); */
		
		</script>

<div id="one"  class="easyui-panel" data-options="fit:true,border:false">
	<my:g id="138">	<a href="#" id="ace" class="easyui-linkbutton adds" data-options="iconCls:'icon-add',plain:true,text:'新增',iconAlign:'left'"></a>|</my:g> 
       <!--  <a href="#" id="update-rule_result"class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true,text:'编辑',iconAlign:'left'"></a>|  -->
        
        
        <!-- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true,text:'删除',iconAlign:'left'"></a>|  -->
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true,text:'刷新',iconAlign:'left'"></a>| 
	<!-- 	日期从<input type= "text" class= "easyui-datebox" /> 到<input type= "text" class= "easyui-datebox" /> -->
		 <input id="search_input_a" class="easyui-textbox " data-options="   	width:120,labelWidth:30"> 
	     <a class="easyui-linkbutton search_a" data-options="iconCls:'icon-search',text:'搜索'"></a>
		
		
		<table id="xiugai_lzs" class="easyui-datagrid mod-add-data-a" data-options="
		fitColumns:true,
		fit:true,
		autoRowHeight:true,
		nowrap:false,
		url:'lzs_findSalarySable',
		rownumbers:true,
		singleSelect:true,
		striped:true,
		pagination:true,
		pageList:[5,10,15,20],
		pageSize:5,
		toolbar:'#tlbar'">
		<thead>
			<tr>
				<th data-options="field:'empno',width:80,checkbox:true"></th> 
				<th data-options="field:'templateId',width:80,align:'center'">模板编号</th>
				<th data-options="field:'templateName',width:80,align:'center'">模板名称</th>
				<th data-options="field:'varsionNumber',width:80,align:'center'">版本数</th>
				<th data-options="field:'templatePerson',width:80,align:'center'">创建者</th>
		<!-- 	<th data-options="field:'templateCreatordate',width:80,align:'center'">创建日期</th>  -->
				 <th data-options="field:'templateCreatordate',width:120,align:'center',
				formatter:function(value,row,index){
					if(value!=null){
					var date = new Date(value);
					return date.toLocaleString();
					}
					return;
				}
				">审核日期</th> 
					<th data-options="field:'accountStartdat',width:120,align:'center',formatter:sroleFormatter">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
				<td>xx</td>
			</tr>
		</tbody>
	</table>
	</div>
	
<!-- 修改 -->
	<div id="update-rule_result_z" class="easyui-dialog" title="规则结果"
		data-options="
         width:440,
         height:360,
	     resizable:false,
	     modal:true,
	     closed:true,
	     buttons:[{
				text:'保存',
				width:60,
				handler:function(){
					$('#rule_result_update_a').form({
					    
						url:'lzs_SalarySablexiugai',
						onSubmit:function(params){
						
						},
						success:function(v){
							v = eval('('+v +')');
							if(v.success){
								$.messager.alert('恭喜', '修改成功');
								$('#aa_lzs').datagrid('reload');
							}else{
								$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
							}
						$.messager.progress('close');// 如果提交成功则隐藏进度条
						
						$('#rule_result_add').form('reset');
						$('#update-rule_result_z').dialog('close');
						}
					}).submit();
				}
				},{
				text:'取消',
				width:60,	
				handler:function(){
					$('#update-rule_result_z').dialog('close');
				}
			}]
        ">
		<div style="margin-left: 21%; margin-top: 10px;">
			<form action="" class="rule_result_update_a" id="rule_result_update_a" style="text-align: right;">
				<table>
					<tr style="display:none;">
						<td><span style="color: red;">*</span>模板编号</td>
						<td><input class="easyui-textbox"
							name="templateId" data-options="required:true" id="rule_result_id_update"> </td>
					</tr>
					<tr>
						<td><span style="color: red;">*</span>模板名称</td>
						<td><input class="easyui-textbox"
							name="templateName" data-options="required:true" id="rule_result_name_update"></td>
					</tr>
					<tr>
						<td><span style="color: red;">*</span>版本数</td>
						<td><input class="easyui-textbox"
							name="varsionNumber" data-options="required:true" id="rule_result_name_update"></td>
					</tr>
						<tr>
						<td><span style="color: red;">*</span>创建者</td>
						<td><input class="easyui-textbox"
							name="templatePerson" data-options="required:true" id="rule_result_name_update"></td>
					</tr>
			
					
			
					
						<tr>
						<td><span style="color: red;"> </span>审核日期</td>
						<td><input class="easyui-datetimebox" name="templateCreatordate"></td>
					</tr>
					
					
					<tr>
						<td><span style="color: red;"> </span></td>
						<td><span style="padding-right:5px;">停用</span>
						<input name="attruState" type="checkbox" value='1' id="rule_result_check_update">
					</tr>
				</table>
			</form>
		</div>
	</div> 
</body>
</html>